package com.cnc.utils;

import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {

//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "2021000118644204";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDQhbUwL76Cg3buWfYHFhQTNVptaVfHQlAI+8A+o/1gmbxdtHE/WCXyvTWY5ZARn1BKXgoJJCHKdm20zdwcZIAqKaSsvJnlsFTr6XNtUXneOrS2KxV5c33u207atmNjAeMizE86xOWmGydFHMH4dbhcIT3Dydy6p+uxNAhPrEYTAXI2P3G+7GE1jWL8WjiHBqE+zkdqh4PkyDG6msf5fta1QkFhsLRcsSG5jBvCcY1IOJvLq7VVJ5Ks5ppTPGYXVSTLKtd8mjMjwfe3NE7ccUgkOlypN6scp9Iw6Yg+qVfxc2naVgAPtyuerZsiA+QfrvydjV83270d3y4Jjme9BRuzAgMBAAECggEALRD4u9VVwzdOeO0Qcy+eXxhk1sixo+r9CTP/tIoUtNAFGetpnlsauH+UGdtja6uW2rvAR4F7nBpEU5M6Qxilanddk8efKzkU4Xeu7q1xPUpKzCQ7m+gOC5VyUWqhyEAcKuUlKnprd57eud0hPuWSVrcIdkwmXGD2W3H3aeC9tFVzS5/VmIU3yRzp+doU36iTowCUky2tCMz5EH2VZJOUoEG9dxfiNDRdsBlbQay9wqLXOxa/EJXHWK4+SkR+l2B92O3knVQDEDK9o+E7Rm20ysin1PcyCJoWGi63rmajSMzqnxaeuFlLIM+Z3XWewpoC2nXuW24S0EXMznPbHsUtwQKBgQD/snYFj8xoWSwI5irgI0g4MHKe+etPW1qsqqUeNOkNarxPc0eWAQej8WIMeT4YuqHweYu7hP1XnZbNSKshs/JFX6JaMF16KhpyrUzYtyaClqCrER3d3KbCXhACU+SvjTRryhKZX6D0MBMXF88ApoqAfC0phI7SB0kN8+RJFOJy+QKBgQDQxPDySWPHutKC9Mh9vDU0k6r5amyhcSwhaXyIi4anmqgcIxcKCpJlDFtODmymz130mBJYY2qly+c1EOEQ/PWchUZ0kGalqxu9BUwvX8MDkv8T4yldDOOEJJoDeZVGAcZ8SszymWK3EZTmj2KTXYLzDHfV9Lh0Q3ib7Eyc1otDCwKBgQCI3vWQKpZHcRxCMzrWOeyprz1b3fnYw9T4wmuajMYHmY/tk47JPAnj9wz+ElRsFlMjD1z95sVaBhA4GOMKKnHQMs4MKwGOqET6B8wv4XIqywh8KbBsF3Xoa0N0i4XJdvONk2B7WxYkQCun2+XBumQ/PLlMFRoCUUYIwvn7KMPCuQKBgChVxI+rKkIOkFmI3audT1JHLYNe0nommXYjIVJoUq3TLaOyC+N+w2YOix17n/Zini6Bqxm0q4g46wTPrAxSM0n4XfJra8maU5OjkGKex9jK78lx3C4ELXj8cV02gmayNR0SfqJojC/+j5w0G8GJEaHPyN9nlrOvzX+imfK7aNCdAoGBAItAsUlKEfpLilycq93tBqyIHobBfpSGGe90aZC6KdzC1UhF/UFJzpm0nkDZSaMfwCq5rlbVa3l8H8ivEuieTh9Ad97E1WwLMsxxmzl9+gPhcXWld1PT68Ss5hBCJxKseOfFQYzGDBe6AbFRDOdDZU3XlgwvgseinenSEC/PS2xD";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAh6CpbP2WBD3a+wAdO9ZP82Nwszstt04+lmbkD9525saNu5BLVmzzbx2De6S/RvXwyG8ZfBzMNRtlww6rrhPnc8SMLBCbnG8e/HNHYOT9Cd7p2fGguMBt6DCVOs+eLxfqObaejRlI0VauOWlV1G8nDr75r5n6/OuVRlRaPDNWlF2HAW9ddhzRz3fcZYnEKjNq9LjQvAXndGcCMNNqcaRHM2frBQ5ytxozTTsQN03E1Vr+KcnF+pKF/Lw8OfhrC4nMIhxiLqZyRE8+15Lg7clWBP1q6wQmaG7KjVxhSMSJZN5UXRkjL8syv2ta4kuIsGLffbehGJrKJAuDa6sjKtQS1QIDAQAB";

    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

    // 支付宝网关
    public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

